#version 330
precision highp float;

uniform sampler2D tex;
in vec2 TexCoord;
in vec4 FrontColor;
in float r,g,b;
out vec4 outColor;

void main()
{
    vec4 t = texture(tex, TexCoord.xy);

    vec4 color = t*FrontColor;
    color.r = (color.r + r)*0.5;
    color.r = (color.r + sin(TexCoord.x))*0.5;
    color.g = (color.g + g)*0.5;
    color.g = (color.g + cos(TexCoord.y))*0.5;
    color.b = (color.b + b)*0.5;
    color.a = 1.0;

    outColor = color;
}



